package com.lonwin.inspectionmanagement.mvp.ui.adapter;

import android.content.Intent;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.animation.BaseAnimation;
import com.lonwin.inspectionmanagement.R;
import com.lonwin.inspectionmanagement.app.AppConstants;
import com.lonwin.inspectionmanagement.mvp.model.entity.bean.NoSortOutBean;
import com.lonwin.inspectionmanagement.mvp.ui.activity.CreatPointRecordActivity;

import java.util.List;

public class NoSortOutRecordAdapter extends BaseQuickAdapter<NoSortOutBean.DataBean.RecordsBean,BaseViewHolder> {
    public NoSortOutRecordAdapter(@Nullable List<NoSortOutBean.DataBean.RecordsBean> data) {
        super(R.layout.nosortout_record_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, NoSortOutBean.DataBean.RecordsBean item) {
      helper.setText(R.id.nosortout_record_item_title,item.getXcgcjl().getTitle())
              .setText(R.id.nosortout_record_item_jlwts,"记录问题数："+item.getXcgcjl().getQuestcount()+"个")
             .setText(R.id.nosortout_record_item_jlgjs,"记录轨迹数："+item.getXcgcjl().getPathcount()+"条");
      helper.<RecyclerView>getView(R.id.nosortout_record_item_RecyclerView1).setLayoutManager(new LinearLayoutManager(mContext));
        NoSortOutRecordItem1Adapter adapter1=new NoSortOutRecordItem1Adapter(item.getQuestTempDtos());
        adapter1.openLoadAnimation(BaseQuickAdapter.SLIDEIN_RIGHT);
      helper.<RecyclerView>getView(R.id.nosortout_record_item_RecyclerView1).setAdapter(adapter1);

        helper.<RecyclerView>getView(R.id.nosortout_record_item_RecyclerView2).setLayoutManager(new LinearLayoutManager(mContext));
        NoSortOutRecordItem2Adapter adapter2=new NoSortOutRecordItem2Adapter(item.getXcpathTemps());
        adapter2.openLoadAnimation(BaseQuickAdapter.SLIDEIN_RIGHT);
        helper.<RecyclerView>getView(R.id.nosortout_record_item_RecyclerView2).setAdapter(adapter2);

    }
}
